fev sex sex_male
1 1.708 F 0
2 1.724 F 0
3 1.720 F 0
4 1.558 M 1
5 1.895 M 1
6 2.336 F 0
2025-10-07
fev sex sex_male
1 1.708 F 0
2 1.724 F 0
3 1.720 F 0
4 1.558 M 1
5 1.895 M 1
6 2.336 F 0
Call:
lm(formula = fev ~ sex_male, data = fev_a)
Coefficients:
(Intercept) sex_male
2.4512 0.3613
The estimated average fev value is 2.45 liters for females. The estimated average fev value is 0.36 liters larger for males.
Call:
lm(formula = fev ~ sex_female, data = fev_b)
Coefficients:
(Intercept) sex_female
2.8124 -0.3613
Refer to the data dictionary.
Refer to part 1 of my code.
Refer to part 2 of my code.
# A tibble: 15 × 9
fev age height .fitted .resid .hat .sigma .cooksd .std.resid
<dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl>
1 1.16 7 47 0.926 0.239 0.0148 0.420 0.00165 0.574
2 2.91 18 66 3.61 -0.702 0.0200 0.419 0.0194 -1.69
3 5.10 19 72 4.32 0.782 0.0171 0.419 0.0205 1.88
4 3.52 19 66 3.66 -0.143 0.0262 0.420 0.00107 -0.345
5 3.34 19 65.5 3.61 -0.262 0.0274 0.420 0.00376 -0.633
6 3.08 18 64.5 3.44 -0.361 0.0231 0.420 0.00598 -0.870
7 2.90 16 63 3.17 -0.267 0.0150 0.420 0.00208 -0.641
8 4.22 18 68 3.83 0.393 0.0167 0.420 0.00506 0.944
9 3.5 17 62 3.11 0.386 0.0228 0.420 0.00672 0.929
10 2.61 16 62 3.06 -0.452 0.0170 0.420 0.00679 -1.09
11 4.09 18 67 3.72 0.369 0.0183 0.420 0.00487 0.887
12 4.40 18 70.5 4.10 0.303 0.0141 0.420 0.00251 0.726
13 2.28 15 60 2.79 -0.508 0.0160 0.420 0.00810 -1.22
14 2.85 18 60 2.95 -0.0963 0.0359 0.420 0.000678 -0.234
15 2.80 16 63 3.17 -0.375 0.0150 0.420 0.00410 -0.900
# A tibble: 7 × 9
fev age height .fitted .resid .hat .sigma .cooksd .std.resid
<dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl>
1 1.72 8 67.5 3.23 -1.51 0.0131 0.416 0.0578 -3.61
2 5.22 12 70 3.72 1.50 0.00637 0.416 0.0276 3.59
3 2.54 14 71 3.94 -1.40 0.00610 0.416 0.0229 -3.35
4 2.22 13 68 3.56 -1.34 0.00377 0.417 0.0129 -3.20
5 5.79 15 69 3.77 2.02 0.00604 0.412 0.0472 4.83
6 5.63 17 73 4.32 1.31 0.0104 0.417 0.0347 3.14
7 5.64 17 70 3.99 1.65 0.0108 0.415 0.0565 3.94
In the pulmonary database, no combination of high leverage and extreme studentized residuals is going to cause concern.
Note: interpreting influential values gets tricky with two independent variables.
Refer to part 3 of my code.
Refer to the programming assingment on my github site.